package com.example.panpan.system.service;

import com.example.common.CacheConstant;
import com.example.common.utils.IMap;
import com.example.panpan.system.mapper.TcRescMapper;
import com.example.panpan.system.model.TcResc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuService {
    @Autowired
    private TcRescMapper tcRescMapper;

    @Cacheable(value = CacheConstant.CacheName.EHCACHE_USER, key = "'" + CacheConstant.CacheKey.INDEX_MENU + "'+ #map['userId'] + '_'+#map['rescTypeArray']",  unless = "#result == null")
    public List<TcResc> selectUserMenuTree(IMap param){
        return tcRescMapper.selectUserMenuTree(param);
    }
}
